#include "settingsview.h"

SettingsView::SettingsView(QWidget *parent)
    : QWidget{parent}
{
    setUI();
}

void SettingsView::setUI()
{



    vLayout = new QVBoxLayout();
    vLayout->setContentsMargins(0,0,0,0);
    vLayout->setSpacing(0);
    setLayout(vLayout);

    label = new QLabel("设置菜单:");
    label->setObjectName("title");
    label->setAlignment(Qt::AlignLeft);




    gridLayout = new QGridLayout();
    gridLayout->setSpacing(0);
    gridLayout->setContentsMargins(0, 0, 0, 0);
    QList <QString> list;
    list<<"亮度"<<"系统版本"<<""<<""<<""<<""<<""<<""<<""<<""<<""<<"";
        for (int i = 0; i < 12; i++){
        pushButton[i] = new QPushButton();
        pushButton[i]->setText(list[i]);
        if(i == 0){
            pushButton[i]->setIcon(QIcon(":/images/se_01_n.png"));
        }
        /* 自动调整按钮的大小 */
        pushButton[i]->setSizePolicy(
            QSizePolicy::Expanding,
            QSizePolicy::Expanding
            );
         pushButton[i]->setObjectName("settingNBtn");
        gridLayout->addWidget(pushButton[i], i/2, i%2);
        if(!list[i].isEmpty()){
            pushButton[i]->setObjectName("settingBtn");
        }
        if(i == 2 || i == 3){
            pushButton[i]->setObjectName("settingbBtn");
        }

    }


    bottomWidget = new QWidget();
    closebtn = new QPushButton("退出",bottomWidget);
    closebtn->setGeometry(0,62,108,62);
    closebtn->setObjectName("baseBtn");

    vLayout->addWidget(label,62);
    vLayout->addLayout(gridLayout,372);
    vLayout->addWidget(bottomWidget,124);


}
